package cn.sanshuilin.kst.system.provider.bean;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;

/**
 * @author greenlee
 * @version v1.0
 * @create 创建时间: 2017-11-28 13:22
 * Copyright 2017  by 三水林科技有限公司
 **/
@Entity
public class Ad implements Serializable{

    private String id;
    private String code;
    private String content;
    private String description;
    private Date fromDate;
    private Integer height;
    private String imageId;

    private String imageName;
    private String locationId;
    private String memo;
    private String position;
    private String pubMemberId;
    private Integer sequenceNo;
    private Date toDate;
    private String visitUrl;
    private Integer width;

    @Transient
    public String getImageName() {
        return imageName;
    }
    public void setImageName(String imageName) {
        this.imageName = imageName;
    }
    @Id
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "Code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "Content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "Description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "FromDate")
    public Date getFromDate() {
        return fromDate;
    }

    public void setFromDate(Date fromDate) {
        this.fromDate = fromDate;
    }

    @Basic
    @Column(name = "Height")
    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    @Basic
    @Column(name = "ImageID")
    public String getImageId() {
        return imageId;
    }

    public void setImageId(String imageId) {
        this.imageId = imageId;
    }

    @Basic
    @Column(name = "LocationID")
    public String getLocationId() {
        return locationId;
    }

    public void setLocationId(String locationId) {
        this.locationId = locationId;
    }

    @Basic
    @Column(name = "Memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "Position")
    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    @Basic
    @Column(name = "PubMemberID")
    public String getPubMemberId() {
        return pubMemberId;
    }

    public void setPubMemberId(String pubMemberId) {
        this.pubMemberId = pubMemberId;
    }

    @Basic
    @Column(name = "SequenceNo")
    public Integer getSequenceNo() {
        return sequenceNo;
    }

    public void setSequenceNo(Integer sequenceNo) {
        this.sequenceNo = sequenceNo;
    }

    @Basic
    @Column(name = "ToDate")
    public Date getToDate() {
        return toDate;
    }

    public void setToDate(Date toDate) {
        this.toDate = toDate;
    }

    @Basic
    @Column(name = "VisitUrl")
    public String getVisitUrl() {
        return visitUrl;
    }

    public void setVisitUrl(String visitUrl) {
        this.visitUrl = visitUrl;
    }

    @Basic
    @Column(name = "Width")
    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Ad ad = (Ad) o;

        if (id != null ? !id.equals(ad.id) : ad.id != null) return false;
        if (code != null ? !code.equals(ad.code) : ad.code != null) return false;
        if (content != null ? !content.equals(ad.content) : ad.content != null) return false;
        if (description != null ? !description.equals(ad.description) : ad.description != null) return false;
        if (fromDate != null ? !fromDate.equals(ad.fromDate) : ad.fromDate != null) return false;
        if (height != null ? !height.equals(ad.height) : ad.height != null) return false;
        if (imageId != null ? !imageId.equals(ad.imageId) : ad.imageId != null) return false;
        if (locationId != null ? !locationId.equals(ad.locationId) : ad.locationId != null) return false;
        if (memo != null ? !memo.equals(ad.memo) : ad.memo != null) return false;
        if (position != null ? !position.equals(ad.position) : ad.position != null) return false;
        if (pubMemberId != null ? !pubMemberId.equals(ad.pubMemberId) : ad.pubMemberId != null) return false;
        if (sequenceNo != null ? !sequenceNo.equals(ad.sequenceNo) : ad.sequenceNo != null) return false;
        if (toDate != null ? !toDate.equals(ad.toDate) : ad.toDate != null) return false;
        if (visitUrl != null ? !visitUrl.equals(ad.visitUrl) : ad.visitUrl != null) return false;
        if (width != null ? !width.equals(ad.width) : ad.width != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (fromDate != null ? fromDate.hashCode() : 0);
        result = 31 * result + (height != null ? height.hashCode() : 0);
        result = 31 * result + (imageId != null ? imageId.hashCode() : 0);
        result = 31 * result + (locationId != null ? locationId.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (position != null ? position.hashCode() : 0);
        result = 31 * result + (pubMemberId != null ? pubMemberId.hashCode() : 0);
        result = 31 * result + (sequenceNo != null ? sequenceNo.hashCode() : 0);
        result = 31 * result + (toDate != null ? toDate.hashCode() : 0);
        result = 31 * result + (visitUrl != null ? visitUrl.hashCode() : 0);
        result = 31 * result + (width != null ? width.hashCode() : 0);
        return result;
    }

    public Ad(String iD, String code, String description, String imageUrl, String imageUrlName, String visitUrl,
              String content, Integer width, Integer height, Integer sequenceNo, String pubMemberID) {
        super();
        id = iD;
        this.code = code;
        this.description = description;
        this.imageId = imageUrl;
        this.imageName = imageUrlName;
        this.visitUrl = visitUrl;
        this.content = content;
        this.width = width;
        this.height = height;
        this.sequenceNo = sequenceNo;
        this.pubMemberId = pubMemberID;
    }

    public Ad(String code, Integer width, Integer height, String description) {

        this.code = code;
        this.description = description;

        this.width = width;
        this.height = height;

    }

    public Ad() {
        super();
    }
}
